package sword_to_1;

public class LeeCode_62 {
    public static void main(String[] args) {

    }
    private static int lastRemaining(int n, int m) {
        int l = 0;
        for (int i = 2; i < n; i++) {
            l = (m + l) % i;
        }
        return l;
    }
}
